	<template>
	<div class="numSty">	 
	<div class="mui-numbox" data-numbox-min='1' :data-numbox-max='maxNum'>
					<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
					<input id="test"  class="mui-input-numbox" type="number" ref="numBox" @change="countChange"/>
					<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
				</div>
	 
	</div>
	</template>


	<script>
	import mui from "../../../lib/mui/js/mui.js"
	export default{	
	  data(){
	    return{
	      pageIndex:1,
	      userComment:''

	    }
	  },
	  props:["maxNum"],
	  watch:{
	  	maxNum(newVal,oldVal){
	  		console.log('newVal',newVal)
	  		mui('.mui-numbox').numbox().setOption('max',newVal);
	  	}
	  },
	  mounted(){
	  	mui('.mui-numbox').numbox();
	  	console.log(this.maxNum)
	  },
	  created(){

	  },
	  methods:{	     
	   countChange(){
	   	const val=this.$refs.numBox.value
	   	const a=mui('.mui-numbox').numbox().getValue()
	   	console.log('numBox',val,a)
	   	this.$emit('getNumber',parseInt(val))
	   }
	 }
	}
	</script>

	<style lang="less" scoped>
	.numSty{
		
		
		
	}

	</style>	
